<div id="maincolumn" class="clearfix wide">

<input type="hidden" name="jobid" id="jobid" value="<?=$job->id;?>" />
<input type="hidden" name="companyid" id="companyid" value="<?=$company->id;?>" />

	<h2><a href="<?=site_url('company/'.$company->company_name);?>"><?=$company->company_name;?></a> &ndash; <?=$job->job_title;?></h2>

<ul id="contextNav" class="clearfix">
		<li><a href="<?=site_url('company/'.$company->company_name.'/'.$job->job_title.'/updates');?>">Updates</a></li>
		<li>Schedule</li>
			<li><a href="<?=site_url('company/'.$company->company_name.'/'.$job->job_title.'/setup');?>">Job Information</a></li>
		<?php if ($permissions->createinvoice):?><li><a href="<?=site_url('company/'.$company->company_name.'/'.$job->job_title.'/billing');?>">Billing</a></li><?php endif;?>
		<?php if ($permissions->assignusers):?><li><a href="<?=site_url('company/'.$company->company_name.'/'.$job->job_title.'/users');?>">User Assignment</a></li><?php endif;?>
	</ul>

	<p class="totalTime"><span>Progress:</span> <?php if ($totaltime > 0 && $allocatedtime > 0) echo number_format(($totaltime / $allocatedtime )*100, 0).'%'; else echo '--';?> <?php if ($permissions->showtime):?><span>Allocated:</span> <?=$allocatedtime;?>hrs <span>Spent:</span> <?=$totaltime;?>hrs <span class="right">Yours:</span> <?=$usertime;?>hrs<?php endif;?></p>

<?php if ($schedule_data):?>
<table id="schedule" border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
	<th class="depts" width="220" height="20">&nbsp;</th>
	<td rowspan="<?=(count($firstcols) + 2);?>" valign="top">
		<div style="width: 730px; overflow-x: auto; height:<?=((count($firstcols) + 1)* 40) - 3;?>px;">
		<table width="100%" cellspacing="0" cellpadding="0">	
			<tr class="day">
				<?=$dateheaders;?>
			</tr>
			<?php foreach($rows as $row):?>
				<?=$row;?>
			<?php endforeach;?>
		</table>
		</div>
	</td>
</tr>
<?php foreach($firstcols as $row):?>
	<tr class="depts">	
		<?=$row;?>
	</tr>
	<?php endforeach;?>
	<tr><td>&nbsp;</td></tr>
</table>

<?php else:?>
	<p>No scheduling data has been entered for any of the departments or tasks associated with this project.</p>
<?php endif;?>


</div>